import Vue from 'vue'

//组件
import Index from '@/page/index/index'

import Notedetail from '@/page/index/notedetails'


import About from '@/page/about/About'
import product from '@/page/product/product'
import partner from '@/page/Partner/partner'
import Honor from '@/page/Honor/Honor'
//内容页展示区域
const root = Vue.component('root', {
  template: '<router-view></router-view>'
});

let routes = [
  {
    path: '/',
    name: 'Index',
    component: Index,
    meta: {
      hidden: true
    }
  }, {
    path: '/',
    component: root,
    meta: {
      requiresAuth: true
    },
    children: [
      {
         path: 'Notedetail',
         name: 'Notedetail',
         component: Notedetail,
      }, 
    {
      //关于我们
       path: 'About',
       name: 'About',
       component: About,
    }, 
    {
      //产品
       path: 'product',
       name: 'product',
       component: product,
    }, 
    {
      //合作伙伴
       path: 'partner',
       name: 'partner',
       component: partner,
    }, 
    {
      //合作伙伴
       path: 'Honor',
       name: 'Honor',
       component: Honor,
    }, 
  ]
  }
]


routes[1].children.forEach(route => {
  if (route.children) {
    if (!route.meta) {
      route.meta = {};
    }
    route.meta.children = route.children;
  }
});

export default routes;

